﻿//======================================================================
//
//        Copyright (C) 2002-2008 S.Sams Lifexperience!
//        All rights reserved
//        FileName : Setting
//        Description :
//        Created by Sam Shen at 2008/8/1 22:41:23
//        http://lab.travelive.com.cn/
//        E-Mail: S.Sams@msn.com
//
//======================================================================

using System;
using System.ComponentModel;

namespace S.Sams.GoogleMap
{
    /// <summary>
    /// 系统参数配置(初始化数据不允许为空)
    /// </summary>
    public class Init
    {
        /// <summary>
        /// 初始化参数配置
        /// </summary>
        /// <param name="pagedomid">初始化-要呈现的地图的DOM对象ID(请确保页面DOM对象存在)</param>
        public Init(string pagedomid)
        {
            PageDomID = pagedomid;
        }

        /// <summary>
        /// 初始化参数配置
        /// </summary>
        /// <param name="pagedomid">初始化-要呈现的地图的DOM对象ID(请确保页面DOM对象存在)</param>
        /// <param name="zoomin">初始化-地图显示的放大系数,  范围一般在 1-17 之间</param>
        public Init(string pagedomid, int zoomin)
        {
            PageDomID = pagedomid;
            ZoomIn = zoomin;
        }

        /// <summary>
        /// 初始化参数配置
        /// </summary>
        /// <param name="pagedomid">初始化-要呈现的地图的DOM对象ID(请确保页面DOM对象存在)</param>
        /// <param name="zoomin">初始化-地图显示的放大系数,  范围一般在 1-17 之间</param>
        /// <param name="maptype">初始化-地图类型</param>
        /// <param name="mapcontrol">初始化-地图工具</param>
        public Init(string pagedomid, int zoomin, MapType maptype, MapControl mapcontrol)
        {
            PageDomID = pagedomid;
            ZoomIn = zoomin;
            Maptype = maptype;
            Mapcontrol = mapcontrol;
        }

        private int _zoomin = 4;
        /// <summary>
        /// 初始化-地图显示的放大系数,  范围一般在 1-17 之间
        /// </summary>
        public int ZoomIn
        {
            get { return _zoomin; }
            set { _zoomin = value; }
        }

        private MapType _maptype = MapType.Normal;
        /// <summary>
        /// 初始化-地图类型
        /// </summary>
        public MapType Maptype
        {
            get { return _maptype; }
            set { _maptype = value; }
        }

        private MapControl _mapcontrol = MapControl.Full;
        /// <summary>
        /// 初始化-地图工具
        /// </summary>
        public MapControl Mapcontrol
        {
            get { return _mapcontrol; }
            set { _mapcontrol = value; }
        }

        /// <summary>
        /// 用户自定义标注设置
        /// </summary>
        public CustomLabel Customlabel
        {
            get;
            set;
        }

        /// <summary>
        /// 初始化-要呈现的地图的DOM对象ID
        /// </summary>
        public string PageDomID
        {
            get;
            set;
        }

        private bool _enabledscrollwheelzoom = false;
        /// <summary>
        /// 允许鼠标滚轮地图放大缩小操作 (默认false)
        /// </summary>
        public bool EnabledScrollWheelZoom
        {
            get { return _enabledscrollwheelzoom; }
            set { _enabledscrollwheelzoom = value; }
        }

        private bool _enablegooglebar = false;
        /// <summary>
        /// 加载地图即时搜索功能 (默认false)
        /// </summary>
        public bool EnableGoogleBar
        {
            get { return _enablegooglebar; }
            set { _enablegooglebar = value; }
        }

        private bool _enablegooglebarshow = false;
        /// <summary>
        /// 默认显示搜索框
        /// </summary>
        public bool EnableGoogleBarShow
        {
            get { return _enablegooglebarshow; }
            set { _enablegooglebarshow = true; }
        }

        private bool _ismaptype = true;
        /// <summary>
        /// 是否显示地图类型选择 (默认true)
        /// </summary>
        public bool IsMapType
        {
            get { return _ismaptype; }
            set { _ismaptype = value; }
        }

        private bool _ismapcontrols = true;
        /// <summary>
        /// 是否显示地图控件工具栏 (默认true)
        /// </summary>
        public bool IsMapControls
        {
            get { return _ismapcontrols; }
            set { _ismapcontrols = value; }
        }

        private bool _ismapscale = true;
        /// <summary>
        /// 是否显示地图比例尺 (默认true)
        /// </summary>
        public bool IsMapScale
        {
            get { return _ismapscale; }
            set { _ismapscale = value; }
        }

        private bool _ismapview = true;
        /// <summary>
        /// 是否显示视图预览 (默认true)
        /// </summary>
        public bool IsMapView
        {
            get { return _ismapview; }
            set { _ismapview = value; }
        }

        private bool _isshowcentermsg = false;
        /// <summary>
        /// 是否显示中心标注点说明 (默认false)
        /// </summary>
        public bool IsShowCenterMsg
        {
            get { return _isshowcentermsg; }
            set { _isshowcentermsg = value; }
        }

        private int _mapviewwidth = 150;
        /// <summary>
        /// 设置缩略图预览 宽度
        /// </summary>
        public int MapViewWidth
        {
            get { return _mapviewwidth; }
            set { _mapviewwidth = value; }
        }

        private int _mapviewheight = 150;
        /// <summary>
        /// 设置缩略图预览 高度
        /// </summary>
        public int MapViewHeight
        {
            get { return _mapviewheight; }
            set { _mapviewheight = value; }
        }

        private bool _isaddline = false;
        /// <summary>
        /// 是否添加标注点之间线条链接 (默认false)
        /// 注: 页面需要载入 VML,
        /// 添加 Html 节点属性: [xmlns:v="urn:schemas-microsoft-com:vml"] , 
        /// 添加样式表支持 [v\:*{behavior:url(#default#VML);}]
        /// </summary>
        public bool IsAddLine
        {
            get { return _isaddline; }
            set { _isaddline = value; }
        }

        private bool _isaddlineend = false;
        /// <summary>
        /// 是否添加标注线条的最后封闭线条 (默认false)
        /// 该操作必须在标注点大于2个以上注点方有效
        /// </summary>
        public bool IsAddLineEnd
        {
            get { return _isaddlineend; }
            set { _isaddlineend = value; }
        }

        private string _addline16color = "#0033FF";
        /// <summary>
        /// 标注线条的16进制颜色码(如: #0033FF)
        /// </summary>
        public string AddLine16Color
        {
            get { return _addline16color; }
            set { _addline16color = value; }
        }

        private int _addlinewidth = 5;
        /// <summary>
        /// 线条宽度
        /// </summary>
        [DefaultValue(5)]
        public int AddLineWidth
        {
            get { return _addlinewidth; }
            set { _addlinewidth = value; }
        }

    }
}
